package com.red.star.wechat.data.entity;

import lombok.Data;
import org.springframework.data.mongodb.core.mapping.Field;

import javax.persistence.Transient;
import java.util.Date;

/**
 * @author nofish.yan@gmail.com
 * @date 2018/2/5.
 * 聊天用户实体
 */
@Data
public class ChatUser {

    /**
     * 粉丝ID，单聊时有值
     */
    @Field(value = "fans_id")
    private Integer fansId;

    @Field
    private Integer adminId;

    private String nickname;

    /**
     * 首页聊天
     */
    @Field(value = "mall_code")
    private String mallCode;

    /**
     * 聊天群组ID，群聊时有值
     */
    @Field(value = "group_id")
    private Integer groupId;

    @Field(value = "c_fans_id")
    private Integer cFansId;

    @Transient
    private String cFansName;

    @Field(value = "avatar_url")
    private String avatarUrl;

    @Field(value = "create_time")
    private Date createTime;

    /**
     * 聊天会话ID
     */
    @Field(value = "chat_session_id")
    private String chatSessionId;

    @Field(value = "last_message")
    private ChatMessage lastMessage;

}
